<script setup lang="ts">
defineProps({
    hideFooter: {
        type: Boolean,
        default: false
    }
})
</script>
<!--就是单纯的保证el-table的整体样式-->
<template>
    <el-card class="full-height" :body-style="{ height: '100%' }">
        <div class="common-table-container">
            <div class="common-table-header">
                <slot name="header"></slot>
            </div>
            <div class="common-table-content">
                <slot name="default"></slot>
            </div>
            <div v-if="!hideFooter" class="common-table-footer">
                <slot name="footer"></slot>
            </div>
        </div>
    </el-card>
</template>

<style scoped lang="scss">
.common-table-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    .common-table-header {
        display: flex;
        align-items: center;
        width: 100%;
        flex-wrap: wrap;
        margin-bottom: 15px;
    }

    .common-table-content {
        flex: 1;
        width: 100%;
        overflow: auto;
    }

    .common-table-footer {
        padding-top: 20px;
        height: 40px;
        width: 100%;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding-right: 20px;
    }
}
</style>
